<div class="navButtons rounded-corners">
	<h2 class="left"><g:message code="title.comment.new"/></h2>
</div>

<g:hasErrors bean="${commentInstance}">
    <div class="errors rounded-corners"><g:renderErrors bean="${commentInstance}" as="list" /></div>
</g:hasErrors>
            
<g:hiddenField name="commentToName" value="${commentToName}" />
<g:hiddenField name="commentToId" value="${commentToId}"/>

<g:formRemote name="newComment" update="commentWrapper" url="[ controller:commentToName, action:'addComment', params:['commentToName':commentToName, 'commentToId':commentToId]]" before="tinyMCE.triggerSave();">
	<richui:richTextEditor name="text" value="${commentInstance?.text}" width="600"/>
    <g:submitButton name="create" class="save" value="${message(code:'default.button.create')}"/>
</g:formRemote>

<g:formRemote name="listComments" update="commentWrapper" url="[ controller:commentToName, action:'comments', params:['commentToName':commentToName, 'commentToId':commentToId]]" before="tinyMCE.triggerSave();">
	<g:submitButton name="list" class="list" value="${message(code:'default.button.comments.list')}"/>
</g:formRemote>